<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>
 <div id="app">
   <cpn></cpn>
  </div>

 <div id="app2">
   <cpn></cpn>
 </div>

     <script src="../js/vue.js"></script>
     <script>

       const cpn=Vue.extend({
         template:`
            <div>
              <h2>我是标题</h2>
              <p>哈哈哈</p>
            </div>
         `
       })
       //全局注册
       //Vue.component('cpn',cpn);
       const app=new Vue({
         el: '#app',
         data: {
           message:'你好vue',
         },
         //局部注册
         components:{
           'cpn': cpn
         }
       })

       const app2=new Vue({
         el:'#app2'
       })
     </script>
</body>
</html>